<script lang="ts">
	import { roadmapStore } from '../store.svelte';
	import CommonState from '../states/CommonState.svelte';
	import InnerResourceState from '../states/InnerResourceState.svelte';

	const selectNode = $derived(
		roadmapStore.nodeList.find(
			(item) =>
				roadmapStore.selectNodeIdList.length > 0 && item.nodeId == roadmapStore.selectNodeIdList[0]
		)
	);
</script>

{#if selectNode != undefined && (roadmapStore.roadmapMode == 'update' || (roadmapStore.roadmapMode == 'view' && roadmapStore.targetMemberUserId != ''))}
	{#if selectNode.content?.typeUrl.endsWith('.InnerResourceData')}
		<InnerResourceState nodeInfo={selectNode} />
	{:else if selectNode.content?.typeUrl.endsWith('.RelateRoadmapData') == false && selectNode.content?.typeUrl.endsWith('.EduLevelData') == false && selectNode.content?.typeUrl.endsWith('.MajorData') == false}
		<CommonState />
	{/if}
{/if}
